<?php

namespace app\admin\controller\weixin;

use app\common\controller\AdminController;
use EasyAdmin\annotation\ControllerAnnotation;
use EasyAdmin\annotation\NodeAnotation;
use think\App;

/**
 * @ControllerAnnotation(title="会员审核管理")
 */
class UserCard extends AdminController
{

    use \app\admin\traits\Curd;

    public function __construct(App $app)
    {
        parent::__construct($app);

        $this->model = new \app\common\model\WeixinUserCard();

        $this->assign('getTypeList', $this->model->getTypeList());

        $this->assign('getStatusList', $this->model->getStatusList());
        $this->with = ['wechat'];

    }

    public function add()
    {
    }

    public function edit()
    {

    }
    public function successInfo($id){
        $res = $this->model->updateDataSave($id,[
            "status"=>1
        ]);
        if($res){
            $this->success("操作成功");
        }else{
            $this->error("操作失败");
        }
    }
    public function errorInfo($id){
        $res = $this->model->updateDataSave($id,[
            "status"=>2
        ]);
        if($res){
            $this->success("操作成功");
        }else{
            $this->error("操作失败");
        }
    }


}